package com.demo.local;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.Month;

public class TestLocalTime {
    public static void main(String[] args) {
        LocalTime time = LocalTime.of(16, 30, 21);
        int hour = time.getHour();
        int minute = time.getMinute();
        int second = time.getSecond();
        System.out.println(hour + ":" + minute + ":" + second);

        LocalDate date = LocalDate.parse("2017-12-29");
        System.out.println(date);
        LocalDateTime dt1 = LocalDateTime.of(2017, Month.DECEMBER, 29, 16, 43, 30);
        LocalDateTime dt2 = LocalDateTime.of(date, time);
        LocalDateTime dt3 = date.atTime(16, 43, 20);
        LocalDateTime dt4 = date.atTime(time);
        LocalDateTime dt5 = time.atDate(date);
        LocalDateTime dt6 = LocalDateTime.now();
        System.out.println(dt6);
    }
}
